//
//  LoginVC.m
//  CFAspace
//
//  Created by 徐凯 on 16/6/14.
//  Copyright © 2016年 Xukai. All rights reserved.
//

#import "LoginVC.h"
#import "RegisterVC.h"

@interface LoginVC ()

@property (weak, nonatomic) IBOutlet UITextField *usernameLab;

@property (weak, nonatomic) IBOutlet UITextField *passwordLab;
@property (weak, nonatomic) IBOutlet UIButton *showPassBtn;

@end

@implementation LoginVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)dismisClick:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (IBAction)registerClick:(id)sender {
    
    RegisterVC *registerVC = [[RegisterVC alloc] init];
    [self presentViewController:registerVC animated:YES completion:nil];
    
    
}


- (IBAction)showBtnClick:(id)sender {
    self.showPassBtn.selected = !self.showPassBtn.selected;
    self.passwordLab.secureTextEntry = !self.showPassBtn.selected;
}


- (IBAction)loginBtnClick:(id)sender {
    
    if(self.usernameLab.text.length == 0)
    {
        [SVProgressHUD showErrorWithStatus:@"请填写用户名或邮箱"];
        return;
    }
    
    if(self.passwordLab.text.length == 0)
    {
        [SVProgressHUD showErrorWithStatus:@"请填写密码"];
        return;
    }
   
}


@end
